home *** CD-ROM | disk | FTP | other *** search
- Path: asimov.oit.umass.edu!not-for-mail
- From: ekh@asimov.oit.umass.edu (Eugene K Hall)
- Newsgroups: comp.lang.c
- Subject: Very Simple <maths.h> problem...
- Date: 28 Mar 1996 21:29:45 GMT
- Organization: University of Massachusetts, Amherst
- Message-ID: <4jf0c9$rs8@nic.umass.edu>
- NNTP-Posting-Host: asimov.oit.umass.edu
- X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
-
- Hi there. I'm getting these errors for a program. It's pathetically easy,
- but I can't seem to rectify it. If anyone could help, it would be great:
-
- It's supposed to work, the man page lists exp() as a valid math.h funct.
- ??
-
- Errors:
- ------
-
- asimov% !cc
- cc int.c
- ld:
- Unresolved:
- exp
-
- Program:
- --------
-
- asimov% cat int.c
- // Program for 224H to Evaluate an Integral by Summing
-
- #include <stdio.h>
- #include <math.h>
-
- int count;
- float x, y, ya, yb, sum;
-
- void main()
- {
-
- x = 0.01;
- y = 0;
- /* Find value */
- for (count = 0; count <= 10000; count++)
-
- {
- ya = x*x*x;
- yb = exp(x)-1;
- y = ya / yb;
- sum += y;
- x += 0.1;
- }
-
- printf("The Final Value = %s", sum);
-
- }
-
-
-
- =========
-
- Any help would be greaty (!) appreciated.
-
- Many thanks,
- Kevin
- (ekh@oitunix.oit.umass.edu)
-
-
-
-
-
-